BigDb Command Line Interface

BigDb's cli is used for migrations, running & recompiling stored queries, and setting up database credentials (ALWAYS gitignore db credentials!).

If you have multiple BigDb apps in one repository, you can setup one bin script for each of them.

Docs

  • Generate a cli script to access your BigDb setup
  • CLI Configuration

Generate a cli script to access your BigDb setup

Built-in CLI support requires taeluf/cli, which is a dev-dependency on BigDb. composer require taeluf/cli v0.1.x-dev --dev to install.

  1. Install taeluf/cli: composer require taeluf/cli v0.1.x-dev --dev
  2. vendor/bin/bigdb create-bin to setup config file and bin script
  3. Add execute permission to generated bin script:
    • Linux: chmod ug+x bin/SCRIPT_NAME
    • Windows: I don't know
    • Mac: Probably the same as linux, but idk

CLI Configuration

config/bigdb.json (config file name is configured during create-bin)

{  
    "app.class": "Tlf\\BigDb",  
    "app.dir": "src\/db",  
    "mysql.host": "localhost",  
    "mysql.database": "test_db_name",  
    "mysql.user": "test_user",  
    "mysql.password": "test_password"  
}